home *** CD-ROM | disk | FTP | other *** search
/ New Masters of Flash / New Masters of Flash.iso / pc / MOVIES / 05.dir / 00216_Text_text14.txt < prev    next >
Text File  |  2000-10-01  |  2KB  |  29 lines

  1. Frame 5 contains a script that simply tells the movie to go to and play the previous frame:
  2.  
  3. prevFrame ();
  4. play ();
  5.  
  6. This way the movie jumps between the two frames to create a continuous loop of calling the mousetracking and 3D calculation scripts. Notice the Play command; without this the movie will jump to the previous frame and stop instead of play.
  7.  
  8. Frame 5 (label: Loop):
  9.  
  10. Frame 5 tells the movie to jump back to frame 4, creating a continuous loop.
  11.  
  12. The script in frame 4 looks like this:
  13.  
  14. if (drag)>0) {
  15.     call ("Refresh 3D View");
  16. }
  17. call ("Mousetracking");
  18. call ("Calc3d");
  19. This script loops through a sequence of Call actions. The Call action is used to execute a script that resides in a frame other than the current frame. This is particularly handy when you need to execute the same script from a number of different frames or buttons. Instead of copying the script onto each frame, you can create one frame that contains the script and simply ΓÇÿcallsΓÇÖ the script whenever needed by pointing to the frame where the script is resident. ItΓÇÖs important to note that the movie doesnΓÇÖt go to that frame,.It simply executes the script and, once finished, returns to execute the remainder or scripts in the current frame.
  20.  
  21. In this case, IΓÇÖve used the Call action so that I could separate the different functions by placing them on separate frames (just to neaten things up a bit).  So, in the script weΓÇÖve just seen, if variable drag>0 it will call the script in frame labelled "Refresh 3D View" (frame 8). It also calls the script responsible for doing the mousetracking and then the script that is responsible for doing the 3d calculations and drawing the 3d object.
  22.  
  23. Frame 5 contains a script that simply tells the movie to go to and play the previous frame:
  24.  
  25. prevFrame ();
  26. play ();
  27.  
  28. This way the movie jumps between the two frames to create a continuous loop of calling the mousetracking and 3D calculation scripts. Notice the Play command; without this the movie will jump to the previous frame and stop instead of play.
  29.